package cn.dust.design.pattern.structural.composite;

/**
 * @Author: dust
 * @Date: 2019/11/26 22:36
 */
public class Test {

    public static void main(String[] args) {
        CatalogComponent linuxCource=new Cource("linux课程",11.0);
        CatalogComponent windowsCource=new Cource("windows课程",11.1);

        CatalogComponent javaCource=new CourceCatalog("Java",10);
        CatalogComponent jdk=new Cource("jdk",1.0);
        CatalogComponent jvm=new Cource("jvm",1.1);
        CatalogComponent jdbc=new Cource("jdbc",1.2);


        javaCource.add(jdbc);
        javaCource.add(jdk);
        javaCource.add(jvm);


        CatalogComponent zong=new CourceCatalog("总目录",1);
        zong.add(linuxCource);
        zong.add(windowsCource);
        zong.add(javaCource);

//        javaCource.print();
        zong.print();

    }

}
